package myJlite.dao;

import java.sql.SQLException;
import java.util.List;

import myJlite.entity.ExamVO;
import myJlite.mapper.UserMapper;

import jvlite.core.JLiteContext;
import jvlite.mvc.annotaion.Part;
import jvlite.plugin.mybatis.MyBatisFacade;
import jvlite.plugin.mybatis.MyBatisSessionMgr;

@Part
//@PointCut(advice = "defaultAdvice", value = "")
public class MybatisDAO extends MyBatisFacade implements IMybatisDAO {
	
/*	@Insert(value = "myBatisSessionMgr")
	public static MyBatisSessionMgr myBatisSessionMgr;*/

	public MybatisDAO(){
		super(JLiteContext.myBatisSessionMgr);
//		super((MyBatisSessionMgr) BeanFactory.getBeanMap().get("jvlite.plugin.mybatis.MyBatisSessionMgr"));
	}
	
	public MybatisDAO(MyBatisSessionMgr mgr) {
		super(mgr);
	}

	public List<ExamVO> getByMybatis(String username) throws SQLException {
		UserMapper mapper = getMapper(UserMapper.class);
		List<ExamVO> users = mapper.findUsers(username, true);
		return users;
	}
}
